<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:a4j="http://richfaces.org/a4j"
      xmlns:rich="http://richfaces.org/rich"
      xmlns:ui="http://java.sun.com/jsf/facelets">
    <ui:composition>
        <h:head>
            <script type="text/javascript">
                javascript:window.history.forward(1);
            </script>
            <script type="text/javascript">
                function updateCostItemName(code, name)
                {
                    var form = document.forms['tripaccount'];
                    form[[currentLine - 1] * 5 + 21].value = code;
                    form[[currentLine - 1] * 5 + 22].value = name;
                }
                function showCostItem(lineid) {
                    currentLine = lineid;
                    window.open("./pubinfo/costItemList.jsf", "费用项目", "height=1024,width=800,toolbar=no,menubar=no,scrollbars=no");
                }
                function showProj() {
                    window.open("./pubinfo/projList.jsf", "项目列表", "height=1024,width=800,toolbar=no,menubar=no,scrollbars=no");
                }
                function updateProjSelect(code, name) {
                    document.getElementById('tripaccount:projCode').value = code;
                    document.getElementById('tripaccount:projName').value = name;
                }
            </script>
            <style type="text/css">
                .pic{
                    margin-bottom: -4px;
                    margin-right: -2px;
                    border:none;
                    width:20px;
                    height:20px;
                }
                .gridStyle input[type='text']{
                    width:200px;
                }
                .gridStyle section{
                    width:200px;
                }
                #table tr{
                    height: 40px;
                }
                img.rf-cal-btn {
                    display:none;
                }
                .demo_fieldset{
                    border-bottom: none;
                    border-left: none;
                    border-right: none;
                    margin: 10px 0px 10px 0px;
                    padding: 10px 0px 10px 0px;
                }
                .tbstyle td{
                    padding: 1px;
                }
                .tbstyle input[type='text']{
                    height: 24px;
                    border: none;
                }
                .c1{
                    vertical-align: top;
                }
                .c2{
                    vertical-align: top;
                }
                .selectStyle{
                    width: 220px;
                }
                .col1{
                    width: 80px;
                }
                .col2{
                }
                .hdClass{
                    background: white;
                    border-bottom: none;
                }
            </style>
        </h:head>
        <h:body>
            <h:form id="tripaccount">
                <rich:panel styleClass="content-hight">
                    <rich:messages globalOnly="true"/>
                    <h:panelGrid columns="4">
                        <h:outputLabel value="单据状态:"/>
                        <h:panelGroup>
                            <h:outputText value="已提交等待审核"  rendered="#{trainput.exp.numberStatus eq '0'}" style="color:green"/>
                            <h:outputText value="未提交" rendered="#{trainput.exp.numberStatus eq '1'}" style="color:red"/>
                            <h:outputText value="审核通过等待支付"  rendered="#{trainput.exp.numberStatus eq '2'}" style="color:blue"/>
                            <h:outputText value="退回修改"  rendered="#{trainput.exp.numberStatus eq '3'}" style="color:red"/>
                            <h:outputText value="确认支付"  rendered="#{trainput.exp.numberStatus eq '4'}" style="color:blue"/>
                            <h:outputText value="撤单"  rendered="#{trainput.exp.numberStatus eq '5'}" style="color:red"/>
                            <h:outputText value="支付完毕"  rendered="#{trainput.exp.numberStatus eq '6'}" style="color:blue"/>
                        </h:panelGroup>
                        <h:outputLabel value="审核信息：" rendered="#{not empty trainput.exp.checkInfo}" style="margin-left: 50px;"/>
                        <h:outputText value="#{trainput.exp.checkInfo}"/>
                    </h:panelGrid>
                    <rich:toolbar  itemSeparator="grida">
                        <rich:toolbarGroup>
                            <h:commandLink  action="#{trainput.add}"
                                            disabled="#{!trainput.showAble}" style=" margin: 1px;">
                                <h:graphicImage value="./images/create_doc.gif" styleClass="pic" title="新增" />
                            </h:commandLink>

                            <h:commandLink action="#{trainput.checkandRep}"
                                           actionListener="#{trainput.clearQueryResult}"
                                           disabled="#{trainput.saveOrNot}" style=" margin: 1px;">
                                <h:graphicImage value="./images/save.gif" styleClass="pic" title="保存" />
                            </h:commandLink>

                            <h:commandLink  action="#{trainput.update}" style=" margin: 1px;"
                                            disabled="#{trainput.addOrUpdate or empty trainput.exp.number or (trainput.exp.numberStatus != '1' and trainput.exp.numberStatus != '3')}">
                                <h:graphicImage value="./images/edit.gif" styleClass="pic" title="修改" />
                            </h:commandLink>

                            <h:commandLink action="#{trainput.delete}"
                                           actionListener="#{trainput.clearQueryResult}"  style=" margin: 1px;"
                                           disabled="#{trainput.addOrUpdate || trainput.exp.number eq '' || (trainput.exp.numberStatus != '1' and trainput.exp.numberStatus != '3')}">
                                <h:graphicImage value="./images/delete.gif" styleClass="pic" title="删除" />
                            </h:commandLink>

                            <h:commandLink action="#{trainput.cancel}"
                                           style=" margin: 1px;text-decoration: none;"
                                           immediate="true"
                                           disabled="#{trainput.saveOrNot}">
                                <h:panelGroup style="white-space: nowrap;">
                                    <h:graphicImage value="./images/cancel.png" styleClass="pic"/>
                                    <h:outputLabel value="取消" />
                                </h:panelGroup>
                            </h:commandLink>

                            <h:commandLink  action="#{trainput.submitBill}"
                                            actionListener="#{trainput.clearQueryResult}" style=" margin: 1px;text-decoration: none;"
                                            disabled="#{trainput.addOrUpdate || trainput.exp.number eq '' || !trainput.saveOrNot || trainput.exp.numberStatus != '1'}" >
                                <h:panelGroup style="white-space: nowrap;">
                                    <h:graphicImage value="./images/submit.png" styleClass="pic"  />
                                    <h:outputLabel value="提交" />
                                </h:panelGroup>
                            </h:commandLink>

                            <h:commandLink  action="#{trainput.rescind}"
                                            actionListener="#{trainput.clearQueryResult}"
                                            style="margin: 1px;text-decoration: none;"
                                            disabled="#{!trainput.browAble||trainput.exp.numberStatus != '0'}">
                                <h:panelGroup style="white-space: nowrap;">
                                    <h:graphicImage value="./images/repeat.png" styleClass="pic" />
                                    <h:outputLabel value="撤单" />
                                </h:panelGroup>
                            </h:commandLink>

                            <h:commandLink  action="#{trainput.getFirst}"
                                            disabled="#{!trainput.showAble}"  style=" margin: 1px;">
                                <h:graphicImage value="./images/btn_page_first.gif" styleClass="pic" title="首张" />
                            </h:commandLink>

                            <h:commandLink  action="#{trainput.previouse}"
                                            disabled="#{!trainput.showAble}"  style=" margin: 1px;">
                                <h:graphicImage value="./images/btn_page_up.gif" styleClass="pic" title="上张" />
                            </h:commandLink>

                            <h:commandLink action="#{trainput.next}"
                                           disabled="#{!trainput.showAble}"  style=" margin: 1px;">
                                <h:graphicImage value="./images/btn_page_down.gif" styleClass="pic" title="下张" />
                            </h:commandLink>

                            <h:commandLink  action="#{trainput.getLast}"
                                            disabled="#{!trainput.showAble}"  style=" margin: 1px;">
                                <h:graphicImage value="./images/btn_page_end.gif" styleClass="pic" title="末张" />
                            </h:commandLink>

                            <a4j:commandLink  render="loanPdf" execute="@form"
                                              oncomplete="#{rich:component('voucherPanel')}.show()"  style=" margin: 1px;"
                                              disabled="#{!trainput.showAble or empty trainput.exp.number}">
                                <h:graphicImage value="./images/print.gif" styleClass="pic" title="打印" />
                            </a4j:commandLink>

                        </rich:toolbarGroup>
                    </rich:toolbar>
                    <p style="text-align:center;font-family:黑体;font-weight:bold;font-size: 20px !important;" >差 旅 报 销 单</p>
                    <hr style="border:1px dashed;"/>
                    <h:panelGrid columns="6" cellpadding="0"
                                 style="width: 780px;text-align: left;"
                                 columnClasses="col1,col2,col1,col2"
                                 styleClass="gridStyle">

                        <h:outputLabel value="单据编号:" />
                        <h:inputText  id="number"  disabled="true"  size="28" value="#{trainput.exp.number}"/>
                        <rich:message for="number"/>

                        <h:outputLabel value="单据日期:" />
                        <rich:calendar id="numDate"
                                       disabled="#{trainput.showAble}"
                                       value="#{trainput.exp.numDate}"
                                       locale="zh_CN"
                                       popup="true"
                                       datePattern="yyyy-MM-dd"
                                       showApplyButton="false"
                                       inputClass="inputstype"
                                       required="true" requiredMessage="不能为空">
                        </rich:calendar>
                        <rich:message for="numDate"/>

                        <h:outputText  value="出差事由:"/>
                        <h:inputText  id="affair" value="#{trainput.exp.affair}" size="28"
                                      required="true" requiredMessage="不能为空"
                                      validatorMessage="请勿超过30个字"
                                      disabled="#{trainput.showAble}">
                            <f:validateLength maximum="30"/>
                        </h:inputText>
                        <rich:message for="affair"/>

                        <h:outputLabel value="预算项目:"  />
                        <h:inputText id="projName" size="28"
                                     disabled="#{trainput.showAble}"
                                     readonly="true"
                                     value="#{trainput.exp.project.finName}"
                                     onclick="#{rich:component('projPanel')}.show();">
                        </h:inputText>
                        <rich:message for="projName"/>

                        <h:outputLabel value="报销部门:" />
                        <h:inputText  id="paydept" disabled="#{trainput.showAble}"
                                      size="28" value="#{trainput.exp.payDept.name}"
                                      onclick="#{rich:component('deptPanel')}.show();"/>
                        <rich:message for="paydept"/>

                        <h:outputLabel value="报销人:" />
                        <h:selectOneMenu id="feePerson" value="#{trainput.exp.feePer.cpsn_number}"
                                         styleClass="selectStyle"
                                         disabled="#{trainput.showAble}">
                            <f:selectItem itemValue="" itemLabel="-请选择-"/>
                            <f:selectItems value="#{trainput.perli}" />
                        </h:selectOneMenu>
                        <rich:message for="feePerson"/>


                        <h:outputLabel value="附件张数:"/>
                        <h:inputText  id="affixAmount" size="28"
                                      value="#{trainput.exp.affixAmount}"
                                      required="true" requiredMessage="不能为空"
                                      disabled="#{trainput.showAble}">
                        </h:inputText>
                        <rich:message for="affixAmount"/>

                        <h:outputLabel value="出发日期:" />
                        <rich:calendar id="beginDate"
                                       value="#{trainput.exp.beginDate}"
                                       locale="zh_CN"
                                       disabled="#{trainput.showAble}"
                                       popup="true"
                                       datePattern="yyyy-MM-dd"
                                       showApplyButton="false"
                                       inputClass="inputstype"
                                       required="true" requiredMessage="不能为空">
                        </rich:calendar>
                        <rich:message for="beginDate"/>

                        <h:outputLabel value="返回日期:" />
                        <rich:calendar id="endDate"
                                       value="#{trainput.exp.endDate}"
                                       locale="zh_CN"
                                       disabled="#{trainput.showAble}"
                                       popup="true"
                                       datePattern="yyyy-MM-dd"
                                       showApplyButton="false"
                                       inputClass="inputstype"
                                       required="true" requiredMessage="不能为空">
                        </rich:calendar>
                        <rich:message for="endDate"/>

                        <h:outputLabel value="出差人:"/>
                        <h:inputText  id="person" size="28" value="#{trainput.exp.chuChaiRen}"
                                      disabled="#{trainput.showAble}"
                                      required="true" requiredMessage="不能为空"
                                      validatorMessage="请勿超过20个字">
                            <f:validateLength maximum="20"/>
                        </h:inputText>
                        <rich:message for="person"/>

                        <h:outputLabel value="备注:"/>
                        <h:inputText  id="memo" size="28" value="#{trainput.exp.memo}"
                                      disabled="#{trainput.showAble}"
                                      validatorMessage="请勿超过50个字">
                            <f:validateLength maximum="50"/>
                        </h:inputText>
                        <rich:message for="memo"/>
                    </h:panelGrid>

                    <fieldset class="demo_fieldset">
                        <legend class="demo_legend">费用明细</legend>

                        <div style="width:780px;overflow: auto;">
                            <rich:dataTable value="#{trainput.model}" var="item"
                                            id="table1" style="width:100%;"
                                            styleClass="tbstyle"
                                            noDataLabel="...">
                                <rich:column style="width:40px;text-align: center;">
                                    <f:facet name="header">
                                        <h:commandLink value="增行" action="#{trainput.addLine}"
                                                       immediate="true"
                                                       disabled="#{trainput.saveOrNot||trainput.exp.numberStatus == '0'
                                                                   ||trainput.exp.numberStatus == '2'
                                                                   ||trainput.exp.numberStatus == '4'}"
                                                       style="white-space: nowrap;text-decoration: none;">
                                        </h:commandLink>
                                    </f:facet>
                                    <h:commandLink value="删除" action="#{trainput.deleteLine}"
                                                   immediate="true"
                                                   disabled="#{trainput.saveOrNot||trainput.exp.numberStatus == '0'
                                                               ||trainput.exp.numberStatus == '2'
                                                               ||trainput.exp.numberStatus == '4'}">
                                    </h:commandLink>
                                </rich:column>
                                <rich:column style="width: 75px;">
                                    <f:facet name="header">
                                        <h:outputText value="出发日期" />
                                    </f:facet>
                                    <rich:calendar  value="#{item.beginDate}"
                                                    disabled="#{trainput.showAble}"
                                                    locale="zh_CN"
                                                    popup="true"
                                                    datePattern="yyyy/MM/dd"
                                                    showApplyButton="false"
                                                    inputStyle="width:70px">
                                    </rich:calendar>
                                </rich:column>
                                <rich:column style="width: 75px;">
                                    <f:facet name="header">
                                        <h:outputText value="到达日期" />
                                    </f:facet>
                                    <rich:calendar value="#{item.endDate}"
                                                   disabled="#{trainput.showAble}"
                                                   locale="zh_CN"
                                                   popup="true"
                                                   enableManualInput="false"
                                                   datePattern="yyyy/MM/dd"
                                                   showApplyButton="false"
                                                   inputStyle="width:70px">
                                    </rich:calendar>
                                </rich:column>
                                <rich:column style=" width: 40px;" >
                                    <f:facet name="header">
                                        <h:outputText value="出发地点" style="white-space: nowrap;"/>
                                    </f:facet>
                                    <h:inputText value="#{item.startLocation}" id="b" size="8" disabled="#{trainput.showAble}"
                                                 validatorMessage="请勿超过20个字">
                                        <a4j:ajax  immediate="false" event="keyup" render="days,travel"/>
                                        <f:validateLength maximum="20"/>
                                    </h:inputText>
                                </rich:column>
                                <rich:column style=" width: 40px;" >
                                    <f:facet name="header">
                                        <h:outputText value="到达地点"  style="white-space: nowrap;"/>
                                    </f:facet>
                                    <h:inputText value="#{item.targetLocation}" id="d" size="8" disabled="#{trainput.showAble}"
                                                 validatorMessage="请勿超过20个字">
                                        <a4j:ajax  immediate="false" event="keyup" render="days,travel"/>
                                        <f:validateLength maximum="20"/>
                                    </h:inputText>
                                </rich:column>
                                <rich:column style=" width: 30px;">
                                    <f:facet name="header">
                                        <h:outputText value="交通席别"/>
                                    </f:facet>
                                    <h:inputText value="#{item.feeDesc}" id="c" size="6" disabled="#{trainput.showAble}"
                                                 validatorMessage="请勿超过20个字">
                                        <f:validateLength maximum="20"/>
                                    </h:inputText>
                                </rich:column>
                                <rich:column style="width:60px;">
                                    <f:facet name="header">
                                        <h:outputText value="交通费" />
                                    </f:facet>
                                    <h:inputText  value="#{item.amount}" id="fee"  size="10"
                                                  converterMessage="请输入正确的数字。" disabled="#{trainput.showAble}">
                                        <a4j:ajax  immediate="false" event="keyup" render="total,remain,htotal"   listener="#{trainput.calcTotal}"/>
                                        <a4j:ajax  immediate="false" event="blur" render="total,remain,htotal"   listener="#{trainput.calcTotal}"/>
                                        <f:validateDoubleRange/>
                                        <f:convertNumber type="double" pattern="###,##0.00"/>
                                    </h:inputText>
                                    <h:message for="fee" style="color:red"/>
                                </rich:column>

                                <rich:column style="width:10px;border-bottom: none;"
                                             headerClass="hdClass">
                                </rich:column>

                                <rich:column style="width:30px;">
                                    <f:facet name="header">
                                        <h:outputText value="住宿天数"/>
                                    </f:facet>
                                    <h:inputText value="#{item.travelDetail.hotelFee.quantity}"
                                                 id="days" size="4" disabled="#{trainput.showAble}">
                                        <f:convertNumber pattern="#,###"/>
                                    </h:inputText>
                                </rich:column>
                                <rich:column style="width:60px;">
                                    <f:facet name="header">
                                        <h:outputText value="住宿费"  style="white-space: nowrap;"/>
                                    </f:facet>
                                    <h:inputText  value="#{item.travelDetail.hotelFee.amount}" id="f" size="10"
                                                  converterMessage="请输入正确的数字。" disabled="#{trainput.showAble}">
                                        <a4j:ajax  immediate="false" event="keyup" render="total,remain,htotal"   listener="#{trainput.calcTotal}"/>
                                        <a4j:ajax  immediate="false" event="blur" render="total,remain,htotal"   listener="#{trainput.calcTotal}"/>
                                        <f:validateDoubleRange/>
                                        <f:convertNumber type="double" pattern="###,##0.00"/>
                                    </h:inputText>
                                    <h:message for="f" style="color:red"/>
                                </rich:column>

                                <rich:column style="width:30px;">
                                    <f:facet name="header">
                                        <h:outputText value="补助天数"/>
                                    </f:facet>
                                    <h:inputText value="#{item.travelDetail.travelGrantsFee.quantity}" id="travel" size="4" disabled="#{trainput.showAble}">
                                        <f:convertNumber pattern="#,###"/>
                                    </h:inputText>
                                </rich:column>
                                <rich:column style="width:60px;">
                                    <f:facet name="header">
                                        <h:outputText value="出差补助金额"  style="white-space: nowrap;"/>
                                    </f:facet>
                                    <h:inputText value="#{item.travelDetail.travelGrantsFee.amount}" id="h" size="12"
                                                 converterMessage="请输入正确的数字。" disabled="#{trainput.showAble}">
                                        <a4j:ajax  immediate="false" event="keyup" render="total,remain,htotal"   listener="#{trainput.calcTotal}"/>
                                        <a4j:ajax  immediate="false" event="blur" render="total,remain,htotal"   listener="#{trainput.calcTotal}"/>
                                        <f:validateDoubleRange/>
                                        <f:convertNumber type="double" pattern="###,##0.00"/>
                                    </h:inputText>
                                    <h:message for="h" style="color:red"/>
                                </rich:column>
                                <rich:column style=" text-align:  right;">
                                    <f:facet name="header">
                                        <h:outputText value="小计" />
                                    </f:facet>
                                    <h:outputText id="htotal" value="#{item.amount + item.travelDetail.hotelFee.amount + item.travelDetail.travelGrantsFee.amount}">
                                        <f:convertNumber type="double" pattern="###,##0.00"/>
                                    </h:outputText>
                                    <h:message for="htotal" style="color:red"/>
                                </rich:column>
                            </rich:dataTable>
                        </div>
                    </fieldset>
                    <div style="margin-top:10px;">
                        <h:panelGrid columns="2" columnClasses="c1,c2" style="width:780px;">                            
                            <h:panelGroup>
                                <h:panelGrid columns="6" style=" text-align: left;height: 100px;" >
                                    <h:outputText value="公杂费:" />
                                    <h:inputText id="travelOffice" value="#{trainput.fee.officeFee.amount}"
                                                 converterMessage="请输入正确的数字。" disabled="#{trainput.showAble}" size="24">
                                        <a4j:ajax  immediate="false" event="keyup" render="total,remain"   listener="#{trainput.calcTotal}"/>
                                        <a4j:ajax  immediate="false" event="blur" render="total,remain"   listener="#{trainput.calcTotal}"/>
                                        <f:convertNumber type="double" pattern="###,##0.00"/>
                                    </h:inputText>
                                    <h:message for="travelOffice" style="color:red"/>
                                    <h:outputText value="订(退)票费:" />
                                    <h:inputText id="orderTickets" value="#{trainput.fee.orderTicketFee.amount}"
                                                 converterMessage="请输入正确的数字。" disabled="#{trainput.showAble}" size="24">
                                        <a4j:ajax  immediate="false" event="keyup" render="total,remain"   listener="#{trainput.calcTotal}"/>
                                        <a4j:ajax  immediate="false" event="blur" render="total,remain"   listener="#{trainput.calcTotal}"/>
                                        <f:convertNumber type="double" pattern="###,##0.00"/>
                                    </h:inputText>
                                    <h:message for="orderTickets" style="color:red"/>
                                    <h:outputText value="市内交通费:" />
                                    <h:inputText id="cityTracffic" value="#{trainput.fee.cityTracfficFee.amount}"
                                                 converterMessage="请输入正确的数字。" disabled="#{trainput.showAble}" size="24">
                                        <a4j:ajax  immediate="false" event="keyup" render="total,remain"   listener="#{trainput.calcTotal}"/>
                                        <a4j:ajax  immediate="false" event="blur" render="total,remain"   listener="#{trainput.calcTotal}"/>
                                        <f:convertNumber type="double" pattern="###,##0.00"/>
                                    </h:inputText>
                                    <h:message for="cityTracffic" style="color:red"/>
                                    <h:outputText value="其他:" />
                                    <h:inputText id="otherCost" value="#{trainput.fee.otherFee.amount}"
                                                 converterMessage="请输入正确的数字。" disabled="#{trainput.showAble}" size="24">
                                        <a4j:ajax  immediate="false" event="keyup" render="total,remain"   listener="#{trainput.calcTotal}"/>
                                        <a4j:ajax  immediate="false" event="blur" render="total,remain"   listener="#{trainput.calcTotal}"/>
                                        <f:convertNumber type="double" pattern="###,##0.00"/>
                                    </h:inputText>
                                    <h:message for="otherCost" style="color:red"/>

                                    <h:outputText  value="费用总金额:"   />
                                    <h:inputText id="total" readonly="true" value="#{trainput.exp.total}" disabled="#{trainput.showAble}" size="24">
                                        <f:convertNumber type="double" pattern="###,##0.00"/>
                                    </h:inputText>
                                    <h:message for="total" style="color:red"/>

                                    <h:outputText  value="待支付金额:"   />
                                    <h:outputText id="remain" value="#{trainput.exp.total - trainput.exp.repayment}">
                                        <f:convertNumber type="double" pattern="###,##0.00"/>
                                    </h:outputText>
                                    <h:message for="remain" style="color:red"/>
                                </h:panelGrid>
                            </h:panelGroup>

                            <h:panelGroup>
                                <div style="overflow: auto">
                                    <rich:dataTable id="editTable" value="#{trainput.styleDetail}" var="std"
                                                    styleClass="styleData" style=" width: 275px;height: 130px;"
                                                    rowClasses="list-row-odd,list-row-even"
                                                    headerClass="table-header" rowKeyVar="rowKey">
                                        <rich:column width="100px;" style=" text-align:  center; width: 100px;" >
                                            <f:facet name="header">
                                                <h:outputText value="支 付 方 式"/>
                                            </f:facet>
                                            <h:outputText value="#{std.name}"/>
                                        </rich:column>

                                        <rich:column width="150px;">
                                            <f:facet name="header">
                                                <h:outputText value="金 额"/>
                                            </f:facet>
                                            <h:inputText value="#{std.amount}" disabled="#{trainput.showAble}">
                                                <a4j:ajax  immediate="false" event="blur" render="editTable"/>
                                                <f:convertNumber type="double" pattern="###,##0.00"/>
                                            </h:inputText>
                                        </rich:column>
                                        <f:facet name="footer">
                                            <h:panelGroup>
                                                <h:outputText  value="支付合计金额:"   />
                                                <h:outputText id="styleTotal" value="#{trainput.styleTotal}">
                                                    <f:convertNumber type="double" pattern="###,##0.00" />
                                                </h:outputText>
                                            </h:panelGroup>
                                        </f:facet>
                                    </rich:dataTable>
                                </div>
                            </h:panelGroup>
                        </h:panelGrid>
                    </div>
                    <hr style="border:1px dashed;"/>
                    <h:panelGrid columns="4" style="width: 780px;text-align: left;"
                                 columnClasses="col1,col2,col1,col2">
                        <h:outputText  value="部门:"   />
                        <h:outputText id="dept1"  value="#{trainput.exp.dept.name}"/>

                        <h:outputText  value="制单人:"   />
                        <h:outputText id="psn1"  value="#{trainput.exp.user.cpsn_name}"/>
                    </h:panelGrid>
                </rich:panel>
            </h:form>
        </h:body>

        <rich:popupPanel id="voucherPanel" width="950" height="600">
            <f:facet name="header">
                <h:panelGroup>
                    <h:outputText value="打印"></h:outputText>
                </h:panelGroup>
            </f:facet>

            <f:facet name="controls">
                <h:outputLink value="#" onclick="#{rich:component('voucherPanel')}.hide();">关闭</h:outputLink>
            </f:facet>
            <a4j:mediaOutput element="object" cacheable="false" id="loanPdf"
                             uriAttribute="data"
                             standby="Loading Pdf..." mimeType="application/pdf"
                             type="application/pdf" style="width: 900px;height: 550px"
                             createContent="#{trainput.process}" />
        </rich:popupPanel>

        <rich:popupPanel id="deptPanel" autosized="true">
            <f:facet name="header">
                <h:panelGroup>
                    <h:outputText value="费用承担部门"></h:outputText>
                </h:panelGroup>
            </f:facet>
            <f:facet name="controls">
                <h:outputLink value="#" onclick="#{rich:component('deptPanel')}.hide();">关闭</h:outputLink>
            </f:facet>
            <h:form>
                <rich:panel>
                    <h:panelGrid columns="2"  border="0" id="mainform">
                        <rich:tree value="#{departmentBean.rootNode}" var="idept"
                                   selectionType="ajax" toggleType="client"
                                   selectionChangeListener="#{trainput.selected}"
                                   style="width:300px" render="paydept,feePerson">
                            <rich:treeNode>
                                <h:outputText value="[#{idept.data.code}]#{idept.data.name}" />
                                <rich:componentControl target="deptPanel" operation="hide" event="click"/>
                            </rich:treeNode>
                        </rich:tree>
                    </h:panelGrid>
                </rich:panel>
            </h:form>

            <f:facet name="footer">
                footer!
            </f:facet>

        </rich:popupPanel>
        <rich:popupPanel id="projPanel" autosized="true">
            <f:facet name="header">项目信息</f:facet>
            <f:facet name="controls">
                <h:outputLink value="#" onclick="#{rich:component('projPanel')}.hide();">关闭</h:outputLink>
            </f:facet>
            <h:form id="projList">
                <rich:dataTable id="editTable" value="#{trainput.finProjModel}" rows="10"  var="pro"
                                onrowmouseover="this.style.backgroundColor='#F1F1F1'"
                                onrowmouseout="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'"
                                rowClasses="list-row-odd,list-row-even">
                    <rich:column>
                        <f:facet name="header">
                            <h:panelGroup>
                                <h:outputText value="预算项目编码"/>
                            </h:panelGroup>
                        </f:facet>
                        <a4j:commandLink id="Projlinks" action="#{trainput.projSelected}"
                                         onclick="#{rich:component('projPanel')}.hide();"
                                         render="projName" >
                            <h:outputText value="#{pro.finCode}"/>
                        </a4j:commandLink>
                    </rich:column>

                    <rich:column>
                        <f:facet name="header">
                            <h:panelGroup>
                                <h:outputText value="预算项目名称"/>
                            </h:panelGroup>
                        </f:facet>
                        <h:outputText value="#{pro.finName}"/>
                    </rich:column>
                    <rich:column>
                        <f:facet name="header">
                            <h:panelGroup>
                                <h:outputText value="备注"/>
                            </h:panelGroup>
                        </f:facet>
                        <h:outputText value="#{pro.memo}"/>
                    </rich:column>

                    <f:facet name="footer">
                        <rich:dataScroller id="ds"></rich:dataScroller>
                    </f:facet>
                </rich:dataTable>
            </h:form>
        </rich:popupPanel>

        <rich:popupPanel id="projQueryPanel" autosized="true">
            <f:facet name="header">项目信息</f:facet>
            <f:facet name="controls">
                <h:outputLink value="#" onclick="#{rich:component('projQueryPanel')}.hide();">关闭</h:outputLink>
            </f:facet>
            <h:form id="projQueryList">
                <rich:dataTable id="editTableQuery" value="#{trainput.finProjModel}" rows="10"  var="pro"
                                onrowmouseover="this.style.backgroundColor='#F1F1F1'"
                                onrowmouseout="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'"
                                rowClasses="list-row-odd,list-row-even">
                    <rich:column>
                        <f:facet name="header">
                            <h:panelGroup>
                                <h:outputText value="预算项目编码"/>
                            </h:panelGroup>
                        </f:facet>
                        <a4j:commandLink id="ProjQuerylinks" action="#{trainput.selectProjForQuery}"
                                         onclick="#{rich:component('projQueryPanel')}.hide();"
                                         render="proName" >
                            <h:outputText value="#{pro.finCode}"/>
                        </a4j:commandLink>
                    </rich:column>

                    <rich:column>
                        <f:facet name="header">
                            <h:panelGroup>
                                <h:outputText value="预算项目名称"/>
                            </h:panelGroup>
                        </f:facet>
                        <h:outputText value="#{pro.finName}"/>
                    </rich:column>
                    <rich:column>
                        <f:facet name="header">
                            <h:panelGroup>
                                <h:outputText value="备注"/>
                            </h:panelGroup>
                        </f:facet>
                        <h:outputText value="#{pro.memo}"/>
                    </rich:column>

                    <f:facet name="footer">
                        <rich:dataScroller id="ds"></rich:dataScroller>
                    </f:facet>
                </rich:dataTable>
            </h:form>
        </rich:popupPanel>
    </ui:composition>
</html>
